<div th:fragment="header(title)">
    <!DOCTYPE html>
    <html xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title th:text="${title}">在线点餐</title>
        <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
        <style>
            .navbar {
                box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
            }

            .dish-card {
                transition: transform .2s;
            }

            .dish-card:hover {
                transform: translateY(-5px);
            }

            .price-tag {
                color: #ff5722;
                font-weight: bold;
            }
        </style>
    </head>
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <div class="container">
            <a class="navbar-brand" th:href="@{/restaurant/all}">🍔 点餐系统</a>
            <div class="d-flex">
                <form th:action="@{/order/all}" method="get">
                    <button type="submit" class="btn btn-outline-primary position-relative me-2">
                        订单 <span class="badge bg-danger position-absolute top-0 start-100 translate-middle">!</span>
                    </button>
                </form>
                <a th:href="@{/user/profile}" class="btn btn-link">我的主页</a>
                <!-- 添加退出按钮 -->
                <a th:if="${session.user != null}" th:href="@{/user/logout}"
                   class="btn btn-outline-danger ms-2">退出</a>
            </div>
        </div>
    </nav>
    </html>
</div>

     